
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    var a = {a:1};
    var b = {b:2};
    var c = {c:3};

    // var obj = {
    //     ...a,
    //     ...b,
    //     ...c,
    // }

    // for(var key in a){
    //     obj[key] = a[key]
    // }

    // Object.assign(targetObj,obj1,obj2,obj3 ....); 将多个对象拼接到目标对象中 (浅拷贝)

    var obj = {a:10,b:20}
    var res = Object.assign(obj,a,b,c);

    console.log(obj);
    console.log(res);
    console.log(res === obj);
   



</script>
</html>